﻿///* 
// * author: www.cnblogs.com/luminji
// * date  : 2011/12/28
// */
//using System;
//using System.Text;
//using System.Collections.Generic;
//using System.Linq;
//using Luminji.Exam.Model.Papers;
//using Microsoft.VisualStudio.TestTools.UnitTesting;
//using Luminji.ExamWeb.Controllers;
//using Moq;
//using System.Web.Mvc;

//namespace Luminji.ExamWeb.Tests.Web.Controllers
//{
//    [TestClass]
//    public class PaperControllerTest
//    {
//        [TestMethod]
//        public void PaperCanShow()
//        {
//            Mock<IPaperService> mock = new Mock<IPaperService>();
//            PaperController pc = new PaperController(mock.Object);
//            string paperName = "name1";
//            string paperCode = "code1";
//            Paper paperMock = new Paper() { PaperName = paperName, PaperCode = paperCode };
//            mock.Setup((rep) => rep.GetPaperWithDetailDetailByPaperCode(paperCode)).Returns(paperMock);
//            //pc.ViewBag.Paper = paperMock;
//            ViewResult vr = pc.Index(paperName, paperCode) as ViewResult;
//            int re1 = paperMock.GetHashCode();
//            int re2 = pc.ViewBag.Paper.GetHashCode();
//            int re3 = vr.ViewBag.Paper.GetHashCode();
//            string p1 = paperMock.PaperName;
//            string p2 = pc.ViewBag.Paper.PaperName;
//            string p3 = vr.ViewBag.Paper.PaperName;
//            Assert.IsTrue((paperMock.PaperName == pc.ViewBag.Paper.PaperName)
//                && (paperMock.PaperName == vr.ViewBag.Paper.PaperName));
//        }

//        [TestMethod]
//        public void Test1()
//        {

//        }
//    }
//}
